package com.mao.strategypattern;

import java.util.HashMap;

public class PayContextFactory {


    static HashMap<PayMethod, Strategy> strategys = new HashMap<>();

    static {
        strategys.put(PayMethod.ALIPAY, new AliPayService());
        strategys.put(PayMethod.WECHATPAY, new WechatPayService());
    }

    enum PayMethod {
        ALIPAY("ALIPAY"),
        WECHATPAY("WECHAT");

        PayMethod(String type) {
        }

    }


    public Strategy getPayMethod(PayMethod method) {
        return strategys.get(method);
    }


}
